<%@ page import="com.generalynx.common.resources.Resources,
                 com.generalynx.common.constants.WebConst"%>
<%@ include file="/WEB-INF/jsp/includes.jsp" %>                 

<%
    String size = request.getParameter("frame_size");
    if (size == null) size = "6"; //default size
    String leftLabel = request.getParameter("left_label");
    if (leftLabel == null) leftLabel = Resources.getString(Resources.ADD);
    String rightLabel = request.getParameter("right_label");
    if (rightLabel == null) rightLabel = Resources.getString(Resources.MEMBERS);
%>

<table id="multseltable">
  <tr>
    <td class="middle">
      <div class="arrow">
        <b><c:out value="${bodyLabel}" />:</b>
      </div>
    </td>
    <td>
      <div class="seldesc">
      <%=leftLabel%> [<c:out value="${left.size}" />]:
      </div>
      <select multiple="multiple" size="<%=size%>" name="left" id="left">
        <c:forEach items="${left}" var="nm" >
            <option value="<c:out value="${nm.id}" />"><c:out value="${nm.label}" /></option>
        </c:forEach>
      </select>
    </td>
    <td class="middle">
      <div class="arrow">
        <a href="#" onclick="return submitForm('right');">&lt;&lt;</a>
      </div>
      <div class="arrow">
        <a href="#" onclick="return submitForm('left');">&gt;&gt;</a>
      </div>
    </td>
    <td>
      <div class="seldesc">
      <%=rightLabel%> [<c:out value="${right.size}" />]:
      </div>
      <select multiple="multiple" size="<%=size%>" name="right" id="right">
        <c:forEach items="${right}" var="m" >
            <option value="<c:out value="${m.id}" />"><c:out value="${m.label}" /></option>
        </c:forEach>
      </select>
    </td>
  </tr>
</table>
<p/>
